home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- // Copyright (C) 1999 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: Date
- // Author: jdc rendering
- //
- // Description:
- //
- // description
- //
-
- global proc int visorAddNewDiskFolderCallback(
- string $visor,
- string $path,
- string $type)
- //
- // Description:
- // This procedure is called by the file browser which was opened to allow the
- // user to choose which directory to open the disk folder in.
- // This procedure creates the folder and adds the directory to the list of
- // directories for which disk folders should exist. The list is stored as an
- // optionVar so that it will persist between sessions and across projects.
- //
- // Returns:
- // The return value is a boolean indicating whether the user's choice from
- // the file browser was valid. If it was invalid, the user will have the
- // opportunity to choose another.
- //
- {
- int $result;
-
- string $typeList[] = `file -q -typ $path`;
- if (size($typeList) > 0 && $typeList[0] == "directory")
- {
- // On NT when the file browser returns a directory path, it doesn't
- // have a "/" at the end. On IRIX it does. The visor ensures the path
- // ends in "/" regardless of OS. So in order for users to be able to
- // remove the folders they create on NT, it's just easier to ensure
- // the path ends in "/".
- //
-
- if(!`about -mac`){
- if (substring($path, size($path), size($path)) != "/")
- {
- $path = ($path + "/");
- }
- }
- visor
- -addFolder
- -type directory
- -openFolder true
- -path $path
- -name $path
- $visor;
- visor -rebuild $visor;
-
- // Add the folder to the optionVar which remembers the user's custom
- // disk folders
- //
- optionVar -stringValueAppend visorCustomDiskFolders $path;
-
- $result = true;
- }
- else
- {
- confirmDialog -m ($path+" is not a directory.")
- -b "OK" -db "OK" -parent projectViewerWindow;
- $result = false;
- }
-
- return $result;
- }
-
- global proc visorAddNewDiskFolder(
- string $visor)
- //
- // Description:
- // This procedure is called when the user chooses "Add new disk folder" from
- // the RMB menu in Visor.
- // This procedure opens a file browser to allow the user to choose which
- // directory the folder should correspond to.
- // The file browser will call the callback procedure above to actually create
- // the folder.
- //
- {
- // Set the directory to the users project area.
- //
- string $wsDir = dirname( `workspace -q -fn` );
-
- if (`file -q -ex $wsDir`)
- {
- workspace -dir $wsDir;
- }
-
- fileBrowser(
- ("visorAddNewDiskFolderCallback " + $visor),
- "Choose Folder",
- "",
- 4);
- }
-